package com.pnnd.stream;

import java.nio.channels.FileChannel;

/**
 * 文件切片
 */
public class FileChunk {

    private int offset;
    private final int length;
    private final long position;
    private final boolean isBuffer;
    private final FileChannel fileChannel;

    public FileChunk(FileChannel fileChannel, long position, int length, boolean isBuffer) {
        this.fileChannel = fileChannel;
        this.position = position;
        this.length = length;
        this.isBuffer = isBuffer;
    }

    public FileChannel getFileChannel() {
        return fileChannel;
    }

    public long getPosition() {
        return position;
    }

    public int getLength() {
        return length;
    }

    public boolean isBuffer() {
        return isBuffer;
    }

}
